Deleted Added
full compact
in.c (123998) in.c (126264)
1/*
2 * Copyright (c) 1982, 1986, 1991, 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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in.c 8.4 (Berkeley) 1/9/95
1/*
2 * Copyright (c) 1982, 1986, 1991, 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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in.c 8.4 (Berkeley) 1/9/95
34 * $FreeBSD: head/sys/netinet/in.c 123998 2003-12-30 16:05:03Z ru $
34 * $FreeBSD: head/sys/netinet/in.c 126264 2004-02-26 04:27:55Z mlaier $
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/sockio.h>
40#include <sys/malloc.h>
41#include <sys/socket.h>
42#include <sys/kernel.h>

--- 315 unchanged lines hidden (view full) ---

358 ia->ia_broadaddr = *(struct sockaddr_in *)&ifr->ifr_broadaddr;
359 return (0);
360
361 case SIOCSIFADDR:
362 error = in_ifinit(ifp, ia,
363 (struct sockaddr_in *) &ifr->ifr_addr, 1);
364 if (error != 0 && iaIsNew)
365 break;
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/sockio.h>
40#include <sys/malloc.h>
41#include <sys/socket.h>
42#include <sys/kernel.h>

--- 315 unchanged lines hidden (view full) ---

358 ia->ia_broadaddr = *(struct sockaddr_in *)&ifr->ifr_broadaddr;
359 return (0);
360
361 case SIOCSIFADDR:
362 error = in_ifinit(ifp, ia,
363 (struct sockaddr_in *) &ifr->ifr_addr, 1);
364 if (error != 0 && iaIsNew)
365 break;
366 if (error == 0)
367 EVENTHANDLER_INVOKE(ifaddr_event, ifp);
366 return (0);
367
368 case SIOCSIFNETMASK:
369 ia->ia_sockmask.sin_addr = ifra->ifra_addr.sin_addr;
370 ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr);
371 return (0);
372
373 case SIOCAIFADDR:

--- 26 unchanged lines hidden (view full) ---

400 (hostIsNew || maskIsNew))
401 error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0);
402 if (error != 0 && iaIsNew)
403 break;
404
405 if ((ifp->if_flags & IFF_BROADCAST) &&
406 (ifra->ifra_broadaddr.sin_family == AF_INET))
407 ia->ia_broadaddr = ifra->ifra_broadaddr;
368 return (0);
369
370 case SIOCSIFNETMASK:
371 ia->ia_sockmask.sin_addr = ifra->ifra_addr.sin_addr;
372 ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr);
373 return (0);
374
375 case SIOCAIFADDR:

--- 26 unchanged lines hidden (view full) ---

402 (hostIsNew || maskIsNew))
403 error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0);
404 if (error != 0 && iaIsNew)
405 break;
406
407 if ((ifp->if_flags & IFF_BROADCAST) &&
408 (ifra->ifra_broadaddr.sin_family == AF_INET))
409 ia->ia_broadaddr = ifra->ifra_broadaddr;
410 if (error == 0)
411 EVENTHANDLER_INVOKE(ifaddr_event, ifp);
408 return (error);
409
410 case SIOCDIFADDR:
411 /*
412 * in_ifscrub kills the interface route.
413 */
414 in_ifscrub(ifp, ia);
415 /*

--- 6 unchanged lines hidden (view full) ---

422 /*
423 * XXX horrible hack to detect that we are being called
424 * from if_detach()
425 */
426 if (ifaddr_byindex(ifp->if_index) == NULL) {
427 in_pcbpurgeif0(&ripcbinfo, ifp);
428 in_pcbpurgeif0(&udbinfo, ifp);
429 }
412 return (error);
413
414 case SIOCDIFADDR:
415 /*
416 * in_ifscrub kills the interface route.
417 */
418 in_ifscrub(ifp, ia);
419 /*

--- 6 unchanged lines hidden (view full) ---

426 /*
427 * XXX horrible hack to detect that we are being called
428 * from if_detach()
429 */
430 if (ifaddr_byindex(ifp->if_index) == NULL) {
431 in_pcbpurgeif0(&ripcbinfo, ifp);
432 in_pcbpurgeif0(&udbinfo, ifp);
433 }
434 EVENTHANDLER_INVOKE(ifaddr_event, ifp);
430 error = 0;
431 break;
432
433 default:
434 if (ifp == 0 || ifp->if_ioctl == 0)
435 return (EOPNOTSUPP);
436 return ((*ifp->if_ioctl)(ifp, cmd, data));
437 }

--- 455 unchanged lines hidden ---
435 error = 0;
436 break;
437
438 default:
439 if (ifp == 0 || ifp->if_ioctl == 0)
440 return (EOPNOTSUPP);
441 return ((*ifp->if_ioctl)(ifp, cmd, data));
442 }

--- 455 unchanged lines hidden ---