Deleted Added
full compact
rtsock.c (191816) rtsock.c (192895)
1/*-
2 * Copyright (c) 1988, 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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
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 * @(#)rtsock.c 8.7 (Berkeley) 10/12/95
1/*-
2 * Copyright (c) 1988, 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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
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 * @(#)rtsock.c 8.7 (Berkeley) 10/12/95
30 * $FreeBSD: head/sys/net/rtsock.c 191816 2009-05-05 10:56:12Z zec $
30 * $FreeBSD: head/sys/net/rtsock.c 192895 2009-05-27 14:11:23Z jamie $
31 */
32#include "opt_sctp.h"
33#include "opt_mpath.h"
34#include "opt_route.h"
35#include "opt_inet.h"
36#include "opt_inet6.h"
37
38#include <sys/param.h>

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

368 break;
369 }
370 }
371 IF_ADDR_UNLOCK(ifp);
372 if (!found) {
373 /*
374 * As a last resort return the 'default' jail address.
375 */
31 */
32#include "opt_sctp.h"
33#include "opt_mpath.h"
34#include "opt_route.h"
35#include "opt_inet.h"
36#include "opt_inet6.h"
37
38#include <sys/param.h>

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

368 break;
369 }
370 }
371 IF_ADDR_UNLOCK(ifp);
372 if (!found) {
373 /*
374 * As a last resort return the 'default' jail address.
375 */
376 ia = ((struct sockaddr_in *)rt->rt_ifa->ifa_addr)->
377 sin_addr;
376 if (prison_get_ip4(cred, &ia) != 0)
377 return (ESRCH);
378 }
379 bzero(&saun->sin, sizeof(struct sockaddr_in));
380 saun->sin.sin_len = sizeof(struct sockaddr_in);
381 saun->sin.sin_family = AF_INET;
382 saun->sin.sin_addr.s_addr = ia.s_addr;
383 info->rti_info[RTAX_IFA] = (struct sockaddr *)&saun->sin;

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

409 break;
410 }
411 }
412 IF_ADDR_UNLOCK(ifp);
413 if (!found) {
414 /*
415 * As a last resort return the 'default' jail address.
416 */
378 if (prison_get_ip4(cred, &ia) != 0)
379 return (ESRCH);
380 }
381 bzero(&saun->sin, sizeof(struct sockaddr_in));
382 saun->sin.sin_len = sizeof(struct sockaddr_in);
383 saun->sin.sin_family = AF_INET;
384 saun->sin.sin_addr.s_addr = ia.s_addr;
385 info->rti_info[RTAX_IFA] = (struct sockaddr *)&saun->sin;

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

411 break;
412 }
413 }
414 IF_ADDR_UNLOCK(ifp);
415 if (!found) {
416 /*
417 * As a last resort return the 'default' jail address.
418 */
419 ia6 = ((struct sockaddr_in6 *)rt->rt_ifa->ifa_addr)->
420 sin6_addr;
417 if (prison_get_ip6(cred, &ia6) != 0)
418 return (ESRCH);
419 }
420 bzero(&saun->sin6, sizeof(struct sockaddr_in6));
421 saun->sin6.sin6_len = sizeof(struct sockaddr_in6);
422 saun->sin6.sin6_family = AF_INET6;
423 bcopy(&ia6, &saun->sin6.sin6_addr, sizeof(struct in6_addr));
424 if (sa6_recoverscope(&saun->sin6) != 0)

--- 1075 unchanged lines hidden ---
421 if (prison_get_ip6(cred, &ia6) != 0)
422 return (ESRCH);
423 }
424 bzero(&saun->sin6, sizeof(struct sockaddr_in6));
425 saun->sin6.sin6_len = sizeof(struct sockaddr_in6);
426 saun->sin6.sin6_family = AF_INET6;
427 bcopy(&ia6, &saun->sin6.sin6_addr, sizeof(struct in6_addr));
428 if (sa6_recoverscope(&saun->sin6) != 0)

--- 1075 unchanged lines hidden ---