net.h (0fac350c54d0a72f5341e15021efcde63eb58a4b) | net.h (f79a8585bb06a4fabe0aa2458586dc480693ea0c) |
---|---|
1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 42 unchanged lines hidden (view full) --- 51 int error; 52 53 /* 54 * XXXGL: we can't use sopeeraddr()/sosockaddr() here since with 55 * INVARIANTS they would check if supplied sockaddr has enough 56 * length. Such notion doesn't even exist in Linux KPI. 57 */ 58 if (peer) { | 1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 42 unchanged lines hidden (view full) --- 51 int error; 52 53 /* 54 * XXXGL: we can't use sopeeraddr()/sosockaddr() here since with 55 * INVARIANTS they would check if supplied sockaddr has enough 56 * length. Such notion doesn't even exist in Linux KPI. 57 */ 58 if (peer) { |
59 if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0) | 59 if ((so->so_state & SS_ISCONNECTED) == 0) |
60 return (-ENOTCONN); 61 62 error = so->so_proto->pr_peeraddr(so, sa); 63 } else 64 error = so->so_proto->pr_sockaddr(so, sa); 65 if (error) 66 return (-error); 67 *sockaddr_len = sa->sa_len; --- 21 unchanged lines hidden --- | 60 return (-ENOTCONN); 61 62 error = so->so_proto->pr_peeraddr(so, sa); 63 } else 64 error = so->so_proto->pr_sockaddr(so, sa); 65 if (error) 66 return (-error); 67 *sockaddr_len = sa->sa_len; --- 21 unchanged lines hidden --- |