| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * INET An implementation of the TCP/IP protocol suite for the LINUX |
|---|
| 3 | 4 | * operating system. INET is implemented using the BSD Socket |
|---|
| .. | .. |
|---|
| 8 | 9 | * Version: @(#)raw.h 1.0.2 05/07/93 |
|---|
| 9 | 10 | * |
|---|
| 10 | 11 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is free software; you can redistribute it and/or |
|---|
| 13 | | - * modify it under the terms of the GNU General Public License |
|---|
| 14 | | - * as published by the Free Software Foundation; either version |
|---|
| 15 | | - * 2 of the License, or (at your option) any later version. |
|---|
| 16 | 12 | */ |
|---|
| 17 | 13 | #ifndef _RAW_H |
|---|
| 18 | 14 | #define _RAW_H |
|---|
| 19 | 15 | |
|---|
| 20 | | - |
|---|
| 16 | +#include <net/inet_sock.h> |
|---|
| 21 | 17 | #include <net/protocol.h> |
|---|
| 22 | 18 | #include <linux/icmp.h> |
|---|
| 23 | 19 | |
|---|
| .. | .. |
|---|
| 61 | 57 | |
|---|
| 62 | 58 | int raw_hash_sk(struct sock *sk); |
|---|
| 63 | 59 | void raw_unhash_sk(struct sock *sk); |
|---|
| 60 | +void raw_init(void); |
|---|
| 64 | 61 | |
|---|
| 65 | 62 | struct raw_sock { |
|---|
| 66 | 63 | /* inet_sock has to be the first member */ |
|---|
| .. | .. |
|---|
| 74 | 71 | return (struct raw_sock *)sk; |
|---|
| 75 | 72 | } |
|---|
| 76 | 73 | |
|---|
| 74 | +static inline bool raw_sk_bound_dev_eq(struct net *net, int bound_dev_if, |
|---|
| 75 | + int dif, int sdif) |
|---|
| 76 | +{ |
|---|
| 77 | +#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV) |
|---|
| 78 | + return inet_bound_dev_eq(READ_ONCE(net->ipv4.sysctl_raw_l3mdev_accept), |
|---|
| 79 | + bound_dev_if, dif, sdif); |
|---|
| 80 | +#else |
|---|
| 81 | + return inet_bound_dev_eq(true, bound_dev_if, dif, sdif); |
|---|
| 82 | +#endif |
|---|
| 83 | +} |
|---|
| 84 | + |
|---|
| 77 | 85 | #endif /* _RAW_H */ |
|---|