Module Name: src
Committed By: elad
Date: Sat May 9 20:54:52 UTC 2009
Modified Files:
src/sys/netinet: in_pcb.c
Log Message:
Add check for IN_MULTICAST() that was taken only to in_pcbbind_port() --
it's necessary in in_pcbbind_addr() as well.
Pointed out by Mihai Chelaru on tech-net@, thanks!
To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/netinet/in_pcb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netinet/in_pcb.c
diff -u src/sys/netinet/in_pcb.c:1.135 src/sys/netinet/in_pcb.c:1.136
--- src/sys/netinet/in_pcb.c:1.135 Thu Apr 30 20:26:09 2009
+++ src/sys/netinet/in_pcb.c Sat May 9 20:54:52 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.c,v 1.135 2009/04/30 20:26:09 elad Exp $ */
+/* $NetBSD: in_pcb.c,v 1.136 2009/05/09 20:54:52 elad Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.135 2009/04/30 20:26:09 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.136 2009/05/09 20:54:52 elad Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -303,7 +303,9 @@
if (sin->sin_family != AF_INET)
return (EAFNOSUPPORT);
- if (!in_nullhost(sin->sin_addr)) {
+ if (IN_MULTICAST(sin->sin_addr.s_addr)) {
+ /* Always succeed; port reuse handled in in_pcbbind_port(). */
+ } else if (!in_nullhost(sin->sin_addr)) {
struct in_ifaddr *ia = NULL;
INADDR_TO_IA(sin->sin_addr, ia);