diff options
Diffstat (limited to 'freebsd/sbin/ifconfig')
-rw-r--r-- | freebsd/sbin/ifconfig/af_inet.c | 4 | ||||
-rw-r--r-- | freebsd/sbin/ifconfig/ifgroup.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/freebsd/sbin/ifconfig/af_inet.c b/freebsd/sbin/ifconfig/af_inet.c index 0e6ace11..3e9ac8ea 100644 --- a/freebsd/sbin/ifconfig/af_inet.c +++ b/freebsd/sbin/ifconfig/af_inet.c @@ -106,8 +106,7 @@ in_getaddr(const char *s, int which) struct netent *np; sin->sin_len = sizeof(*sin); - if (which != MASK) - sin->sin_family = AF_INET; + sin->sin_family = AF_INET; if (which == ADDR) { char *p = NULL; @@ -126,6 +125,7 @@ in_getaddr(const char *s, int which) *p = '/'; errx(1, "%s: bad value (width %s)", s, errstr); } + min->sin_family = AF_INET; min->sin_len = sizeof(*min); min->sin_addr.s_addr = htonl(~((1LL << (32 - masklen)) - 1) & 0xffffffff); diff --git a/freebsd/sbin/ifconfig/ifgroup.c b/freebsd/sbin/ifconfig/ifgroup.c index daffb3b0..c8dae3b9 100644 --- a/freebsd/sbin/ifconfig/ifgroup.c +++ b/freebsd/sbin/ifconfig/ifgroup.c @@ -62,7 +62,7 @@ setifgroup(const char *group_name, int d, int s, const struct afswtch *rafp) if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ) errx(1, "setifgroup: group name too long"); - if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) == -1) + if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) == -1 && errno != EEXIST) err(1," SIOCAIFGROUP"); } @@ -80,7 +80,7 @@ unsetifgroup(const char *group_name, int d, int s, const struct afswtch *rafp) if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ) errx(1, "unsetifgroup: group name too long"); - if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) == -1) + if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) == -1 && errno != ENOENT) err(1, "SIOCDIFGROUP"); } |