af_inet.c (191121) | af_inet.c (194799) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#ifndef lint 31static const char rcsid[] = | 1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#ifndef lint 31static const char rcsid[] = |
32 "$FreeBSD: head/sbin/ifconfig/af_inet.c 191121 2009-04-15 20:53:34Z brooks $"; | 32 "$FreeBSD: head/sbin/ifconfig/af_inet.c 194799 2009-06-23 23:49:52Z delphij $"; |
33#endif /* not lint */ 34 35#include <sys/types.h> 36#include <sys/ioctl.h> 37#include <sys/socket.h> 38#include <net/if.h> 39 40#include <err.h> --- 84 unchanged lines hidden (view full) --- 125 0xffffffff); 126 } 127 } 128 129 if (inet_aton(s, &sin->sin_addr)) 130 return; 131 if ((hp = gethostbyname(s)) != 0) 132 bcopy(hp->h_addr, (char *)&sin->sin_addr, | 33#endif /* not lint */ 34 35#include <sys/types.h> 36#include <sys/ioctl.h> 37#include <sys/socket.h> 38#include <net/if.h> 39 40#include <err.h> --- 84 unchanged lines hidden (view full) --- 125 0xffffffff); 126 } 127 } 128 129 if (inet_aton(s, &sin->sin_addr)) 130 return; 131 if ((hp = gethostbyname(s)) != 0) 132 bcopy(hp->h_addr, (char *)&sin->sin_addr, |
133 MIN(hp->h_length, sizeof(sin->sin_addr))); | 133 MIN((size_t)hp->h_length, sizeof(sin->sin_addr))); |
134 else if ((np = getnetbyname(s)) != 0) 135 sin->sin_addr = inet_makeaddr(np->n_net, INADDR_ANY); 136 else 137 errx(1, "%s: bad value", s); 138#undef MIN 139} 140 141static void --- 59 unchanged lines hidden --- | 134 else if ((np = getnetbyname(s)) != 0) 135 sin->sin_addr = inet_makeaddr(np->n_net, INADDR_ANY); 136 else 137 errx(1, "%s: bad value", s); 138#undef MIN 139} 140 141static void --- 59 unchanged lines hidden --- |