Deleted Added
full compact
in6_pcb.c (81127) in6_pcb.c (83130)
1/* $FreeBSD: head/sys/netinet6/in6_pcb.c 81127 2001-08-04 17:10:14Z ume $ */
1/* $FreeBSD: head/sys/netinet6/in6_pcb.c 83130 2001-09-06 02:40:43Z jlemon $ */
2/* $KAME: in6_pcb.c,v 1.31 2001/05/21 05:45:10 jinmei Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

419
420 /*
421 * If the caller doesn't specify the source address but
422 * the outgoing interface, use an address associated with
423 * the interface.
424 */
425 if (pi && pi->ipi6_ifindex) {
426 /* XXX boundary check is assumed to be already done. */
2/* $KAME: in6_pcb.c,v 1.31 2001/05/21 05:45:10 jinmei Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

419
420 /*
421 * If the caller doesn't specify the source address but
422 * the outgoing interface, use an address associated with
423 * the interface.
424 */
425 if (pi && pi->ipi6_ifindex) {
426 /* XXX boundary check is assumed to be already done. */
427 ia6 = in6_ifawithscope(ifindex2ifnet[pi->ipi6_ifindex],
428 dst);
427 ia6 = in6_ifawithscope(ifnet_byindex(pi->ipi6_ifindex), dst);
429 if (ia6 == 0) {
430 *errorp = EADDRNOTAVAIL;
431 return(0);
432 }
433 return(&satosin6(&ia6->ia_addr)->sin6_addr);
434 }
435
436 /*

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

448 * I'm not sure if boundary check for scope_id is done
449 * somewhere...
450 */
451 if (dstsock->sin6_scope_id < 0 ||
452 if_index < dstsock->sin6_scope_id) {
453 *errorp = ENXIO; /* XXX: better error? */
454 return(0);
455 }
428 if (ia6 == 0) {
429 *errorp = EADDRNOTAVAIL;
430 return(0);
431 }
432 return(&satosin6(&ia6->ia_addr)->sin6_addr);
433 }
434
435 /*

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

447 * I'm not sure if boundary check for scope_id is done
448 * somewhere...
449 */
450 if (dstsock->sin6_scope_id < 0 ||
451 if_index < dstsock->sin6_scope_id) {
452 *errorp = ENXIO; /* XXX: better error? */
453 return(0);
454 }
456 ia6 = in6_ifawithscope(ifindex2ifnet[dstsock->sin6_scope_id],
455 ia6 = in6_ifawithscope(ifnet_byindex(dstsock->sin6_scope_id),
457 dst);
458 if (ia6 == 0) {
459 *errorp = EADDRNOTAVAIL;
460 return(0);
461 }
462 return(&satosin6(&ia6->ia_addr)->sin6_addr);
463 }
464

--- 649 unchanged lines hidden ---
456 dst);
457 if (ia6 == 0) {
458 *errorp = EADDRNOTAVAIL;
459 return(0);
460 }
461 return(&satosin6(&ia6->ia_addr)->sin6_addr);
462 }
463

--- 649 unchanged lines hidden ---