Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/netinet Pull up following revision(s) (requested by c...
details: https://anonhg.NetBSD.org/src/rev/045c596a3069
branches: netbsd-7
changeset: 799202:045c596a3069
user: snj <snj%NetBSD.org@localhost>
date: Tue Apr 14 05:17:31 2015 +0000
description:
Pull up following revision(s) (requested by christos in ticket #689):
sys/netinet/in.c: revision 1.149
Don't pass junk in sin_family and sin_len for SIOCGIFNETMASK, and explain why.
XXX: pullup 7?
diffstat:
sys/netinet/in.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diffs (42 lines):
diff -r 1506256e94a3 -r 045c596a3069 sys/netinet/in.c
--- a/sys/netinet/in.c Tue Apr 14 05:15:57 2015 +0000
+++ b/sys/netinet/in.c Tue Apr 14 05:17:31 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in.c,v 1.147 2014/07/01 05:49:18 rtr Exp $ */
+/* $NetBSD: in.c,v 1.147.2.1 2015/04/14 05:17:31 snj Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.147 2014/07/01 05:49:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.147.2.1 2015/04/14 05:17:31 snj Exp $");
#include "opt_inet.h"
#include "opt_inet_conf.h"
@@ -427,6 +427,7 @@
ia->ia_ifa.ifa_getifa = NULL;
#endif /* IPSELSRC */
ia->ia_sockmask.sin_len = 8;
+ ia->ia_sockmask.sin_family = AF_INET;
if (ifp->if_flags & IFF_BROADCAST) {
ia->ia_broadaddr.sin_len = sizeof(ia->ia_addr);
ia->ia_broadaddr.sin_family = AF_INET;
@@ -473,7 +474,14 @@
break;
case SIOCGIFNETMASK:
- ifreq_setaddr(cmd, ifr, sintocsa(&ia->ia_sockmask));
+ /*
+ * We keep the number of trailing zero bytes the sin_len field
+ * of ia_sockmask, so we fix this before we pass it back to
+ * userland.
+ */
+ oldaddr = ia->ia_sockmask;
+ oldaddr.sin_len = sizeof(struct sockaddr_in);
+ ifreq_setaddr(cmd, ifr, (const void *)&oldaddr);
break;
case SIOCSIFDSTADDR:
Home |
Main Index |
Thread Index |
Old Index