diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2012-04-18 23:39:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-21 15:52:25 -0400 |
commit | 4a17fd5229c1b6066aa478f6b690f8293ce811a1 (patch) | |
tree | f6acd00935d2d7a990befb4c77f57fdf39f46689 /include/net | |
parent | 59c55bdde856c4000bbeb33ba212c3df6f1997a4 (diff) |
sock: Introduce named constants for sk_reuse
Name them in a "backward compatible" manner, i.e. reuse or not
are still 1 and 0 respectively. The reuse value of 2 means that
the socket with it will forcibly reuse everyone else's port.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sock.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index a6ba1f8871fd..4cdb9b3050f4 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -376,6 +376,17 @@ struct sock { | |||
376 | void (*sk_destruct)(struct sock *sk); | 376 | void (*sk_destruct)(struct sock *sk); |
377 | }; | 377 | }; |
378 | 378 | ||
379 | /* | ||
380 | * SK_CAN_REUSE and SK_NO_REUSE on a socket mean that the socket is OK | ||
381 | * or not whether his port will be reused by someone else. SK_FORCE_REUSE | ||
382 | * on a socket means that the socket will reuse everybody else's port | ||
383 | * without looking at the other's sk_reuse value. | ||
384 | */ | ||
385 | |||
386 | #define SK_NO_REUSE 0 | ||
387 | #define SK_CAN_REUSE 1 | ||
388 | #define SK_FORCE_REUSE 2 | ||
389 | |||
379 | static inline int sk_peek_offset(struct sock *sk, int flags) | 390 | static inline int sk_peek_offset(struct sock *sk, int flags) |
380 | { | 391 | { |
381 | if ((flags & MSG_PEEK) && (sk->sk_peek_off >= 0)) | 392 | if ((flags & MSG_PEEK) && (sk->sk_peek_off >= 0)) |