summaryrefslogtreecommitdiff
path: root/zebra/ioctl.c
diff options
context:
space:
mode:
authorpaul <paul>2003-06-12 02:13:45 +0000
committerpaul <paul>2003-06-12 02:13:45 +0000
commit0e4f190ebf5a26e4b66fb49cd74ae0ff0c7e0863 (patch)
treecb2d35c5a85e8dd5f70db46604e6dda55b9bc9f4 /zebra/ioctl.c
parent9238b1e82efd5c6a7192491e2ccde2dfa32322c8 (diff)
2003-06-12 Paul Jakma <paul@dishone.st>
* zebra/ioctl.c: Properly zero-out struct ifreq before passing it to the SIOCSIFFLAGS ioctl(2), so that it doesn't occasionally trigger promisc mode on interface. Reported/tested by: Vladimir B. Grebenschikov <vova@sw.ru> (patch snarfed taken from FreeBSD ports)
Diffstat (limited to 'zebra/ioctl.c')
-rw-r--r--zebra/ioctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/zebra/ioctl.c b/zebra/ioctl.c
index f8e7f22b..1a682e27 100644
--- a/zebra/ioctl.c
+++ b/zebra/ioctl.c
@@ -364,6 +364,7 @@ if_set_flags (struct interface *ifp, unsigned long flags)
int ret;
struct ifreq ifreq;
+ bzero(&ifreq, sizeof(struct ifreq));
ifreq_set_name (&ifreq, ifp);
ifreq.ifr_flags = ifp->flags;
@@ -386,6 +387,7 @@ if_unset_flags (struct interface *ifp, unsigned long flags)
int ret;
struct ifreq ifreq;
+ bzero(&ifreq, sizeof(struct ifreq));
ifreq_set_name (&ifreq, ifp);
ifreq.ifr_flags = ifp->flags;
@@ -488,6 +490,9 @@ if_prefix_add_ipv6 (struct interface *ifp, struct connected *ifc)
mask.sin6_len = sizeof (struct sockaddr_in6);
#endif
memcpy (&addreq.ifra_prefixmask, &mask, sizeof (struct sockaddr_in6));
+
+ addreq.ifra_lifetime.ia6t_vltime = 0xffffffff;
+ addreq.ifra_lifetime.ia6t_pltime = 0xffffffff;
#ifdef HAVE_IFRA_LIFETIME
addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;