summaryrefslogtreecommitdiffstats
path: root/src/network/netdev
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/netdev')
-rw-r--r--src/network/netdev/fou-tunnel.c6
-rw-r--r--src/network/netdev/ipoib.c3
-rw-r--r--src/network/netdev/l2tp-tunnel.c9
-rw-r--r--src/network/netdev/macvlan.c3
-rw-r--r--src/network/netdev/netdev.c6
-rw-r--r--src/network/netdev/tunnel.c6
-rw-r--r--src/network/netdev/vlan.c3
-rw-r--r--src/network/netdev/vxlan.c3
-rw-r--r--src/network/netdev/wireguard.c21
-rw-r--r--src/network/netdev/wlan.c6
10 files changed, 22 insertions, 44 deletions
diff --git a/src/network/netdev/fou-tunnel.c b/src/network/netdev/fou-tunnel.c
index cd8f2f8087..acd609f296 100644
--- a/src/network/netdev/fou-tunnel.c
+++ b/src/network/netdev/fou-tunnel.c
@@ -157,7 +157,7 @@ int config_parse_ip_protocol(
void *data,
void *userdata) {
- uint8_t *ret = data;
+ uint8_t *ret = ASSERT_PTR(data);
unsigned protocol;
/* linux/fou.h defines the netlink field as one byte, so we need to reject protocols numbers that
* don't fit in one byte. */
@@ -167,7 +167,6 @@ int config_parse_ip_protocol(
assert(section);
assert(lvalue);
assert(rvalue);
- assert(data);
r = parse_ip_protocol(rvalue);
if (r >= 0)
@@ -204,14 +203,13 @@ int config_parse_fou_tunnel_address(
void *data,
void *userdata) {
- union in_addr_union *addr = data;
+ union in_addr_union *addr = ASSERT_PTR(data);
FouTunnel *t = userdata;
int r, *f;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(data);
if (streq(lvalue, "Local"))
f = &t->local_family;
diff --git a/src/network/netdev/ipoib.c b/src/network/netdev/ipoib.c
index 0e27f5f044..5dd9286d57 100644
--- a/src/network/netdev/ipoib.c
+++ b/src/network/netdev/ipoib.c
@@ -119,13 +119,12 @@ int config_parse_ipoib_pkey(
void *data,
void *userdata) {
- uint16_t u, *pkey = data;
+ uint16_t u, *pkey = ASSERT_PTR(data);
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(data);
if (isempty(rvalue)) {
*pkey = 0; /* 0 means unset. */
diff --git a/src/network/netdev/l2tp-tunnel.c b/src/network/netdev/l2tp-tunnel.c
index 7e7d167928..2bce0fc5b2 100644
--- a/src/network/netdev/l2tp-tunnel.c
+++ b/src/network/netdev/l2tp-tunnel.c
@@ -481,15 +481,13 @@ int config_parse_l2tp_tunnel_local_address(
_cleanup_free_ char *addr_or_type = NULL, *ifname = NULL;
L2tpLocalAddressType type;
- L2tpTunnel *t = userdata;
- const char *p = rvalue;
+ L2tpTunnel *t = ASSERT_PTR(userdata);
+ const char *p = ASSERT_PTR(rvalue);
union in_addr_union a;
int r, f;
assert(filename);
assert(lvalue);
- assert(rvalue);
- assert(t);
if (isempty(rvalue)) {
t->local_ifname = mfree(t->local_ifname);
@@ -575,14 +573,13 @@ int config_parse_l2tp_tunnel_remote_address(
void *data,
void *userdata) {
- L2tpTunnel *t = userdata;
+ L2tpTunnel *t = ASSERT_PTR(userdata);
union in_addr_union a;
int r, f;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(t);
if (isempty(rvalue)) {
t->remote = IN_ADDR_NULL;
diff --git a/src/network/netdev/macvlan.c b/src/network/netdev/macvlan.c
index aca05f0f77..1114bb0cb1 100644
--- a/src/network/netdev/macvlan.c
+++ b/src/network/netdev/macvlan.c
@@ -84,7 +84,7 @@ int config_parse_macvlan_broadcast_queue_size(
void *data,
void *userdata) {
- MacVlan *m = userdata;
+ MacVlan *m = ASSERT_PTR(userdata);
uint32_t v;
int r;
@@ -93,7 +93,6 @@ int config_parse_macvlan_broadcast_queue_size(
assert(lvalue);
assert(rvalue);
assert(data);
- assert(userdata);
if (isempty(rvalue)) {
m->bc_queue_length = UINT32_MAX;
diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c
index 212df3daa0..038a27c118 100644
--- a/src/network/netdev/netdev.c
+++ b/src/network/netdev/netdev.c
@@ -902,11 +902,10 @@ int config_parse_netdev_kind(
void *data,
void *userdata) {
- NetDevKind k, *kind = data;
+ NetDevKind k, *kind = ASSERT_PTR(data);
assert(filename);
assert(rvalue);
- assert(data);
k = netdev_kind_from_string(rvalue);
if (k < 0) {
@@ -938,10 +937,9 @@ int config_parse_netdev_hw_addr(
void *data,
void *userdata) {
- struct hw_addr_data *hw_addr = data;
+ struct hw_addr_data *hw_addr = ASSERT_PTR(data);
assert(rvalue);
- assert(data);
if (streq(rvalue, "none")) {
*hw_addr = HW_ADDR_NONE;
diff --git a/src/network/netdev/tunnel.c b/src/network/netdev/tunnel.c
index 78a8708b21..db414a8943 100644
--- a/src/network/netdev/tunnel.c
+++ b/src/network/netdev/tunnel.c
@@ -778,13 +778,12 @@ int config_parse_tunnel_local_address(
union in_addr_union buffer = IN_ADDR_NULL;
NetDevLocalAddressType type;
- Tunnel *t = userdata;
+ Tunnel *t = ASSERT_PTR(userdata);
int r, f;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(userdata);
if (isempty(rvalue) || streq(rvalue, "any"))
return unset_local(t);
@@ -846,13 +845,12 @@ int config_parse_tunnel_remote_address(
void *userdata) {
union in_addr_union buffer;
- Tunnel *t = userdata;
+ Tunnel *t = ASSERT_PTR(userdata);
int r, f;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(userdata);
if (isempty(rvalue) || streq(rvalue, "any"))
return unset_remote(t);
diff --git a/src/network/netdev/vlan.c b/src/network/netdev/vlan.c
index 3f9f594759..a3d961dac3 100644
--- a/src/network/netdev/vlan.c
+++ b/src/network/netdev/vlan.c
@@ -129,13 +129,12 @@ int config_parse_vlan_qos_maps(
void *data,
void *userdata) {
- Set **s = data;
+ Set **s = ASSERT_PTR(data);
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(data);
if (isempty(rvalue)) {
*s = set_free(*s);
diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c
index d93084c2d4..589161938a 100644
--- a/src/network/netdev/vxlan.c
+++ b/src/network/netdev/vxlan.c
@@ -207,7 +207,7 @@ int config_parse_vxlan_address(
void *data,
void *userdata) {
- VxLan *v = userdata;
+ VxLan *v = ASSERT_PTR(userdata);
union in_addr_union *addr = data, buffer;
int *family, f, r;
@@ -215,7 +215,6 @@ int config_parse_vxlan_address(
assert(lvalue);
assert(rvalue);
assert(data);
- assert(userdata);
if (streq(lvalue, "Local"))
family = &v->local_family;
diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c
index b858e20ed6..51e7e02990 100644
--- a/src/network/netdev/wireguard.c
+++ b/src/network/netdev/wireguard.c
@@ -296,10 +296,9 @@ static int wireguard_set_interface(NetDev *netdev) {
}
static int on_resolve_retry(sd_event_source *s, usec_t usec, void *userdata) {
- WireguardPeer *peer = userdata;
+ WireguardPeer *peer = ASSERT_PTR(userdata);
NetDev *netdev;
- assert(peer);
assert(peer->wireguard);
netdev = NETDEV(peer->wireguard);
@@ -332,11 +331,10 @@ static int wireguard_peer_resolve_handler(
const struct addrinfo *ai,
void *userdata) {
- WireguardPeer *peer = userdata;
+ WireguardPeer *peer = ASSERT_PTR(userdata);
NetDev *netdev;
int r;
- assert(peer);
assert(peer->wireguard);
netdev = NETDEV(peer->wireguard);
@@ -462,11 +460,10 @@ int config_parse_wireguard_listen_port(
void *data,
void *userdata) {
- uint16_t *s = data;
+ uint16_t *s = ASSERT_PTR(data);
int r;
assert(rvalue);
- assert(data);
if (isempty(rvalue) || streq(rvalue, "auto")) {
*s = 0;
@@ -887,15 +884,13 @@ int config_parse_wireguard_route_table(
void *data,
void *userdata) {
- NetDev *netdev = userdata;
- uint32_t *table = data;
+ NetDev *netdev = ASSERT_PTR(userdata);
+ uint32_t *table = ASSERT_PTR(data);
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(data);
- assert(userdata);
if (isempty(rvalue) || parse_boolean(rvalue) == 0) {
*table = 0; /* Disabled. */
@@ -926,14 +921,13 @@ int config_parse_wireguard_peer_route_table(
void *userdata) {
_cleanup_(wireguard_peer_free_or_set_invalidp) WireguardPeer *peer = NULL;
- NetDev *netdev = userdata;
+ NetDev *netdev = ASSERT_PTR(userdata);
Wireguard *w;
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(netdev);
assert(netdev->manager);
w = WIREGUARD(netdev);
@@ -981,13 +975,12 @@ int config_parse_wireguard_route_priority(
void *data,
void *userdata) {
- uint32_t *priority = data;
+ uint32_t *priority = ASSERT_PTR(data);
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(data);
if (isempty(rvalue)) {
*priority = 0;
diff --git a/src/network/netdev/wlan.c b/src/network/netdev/wlan.c
index bf23ae3d3f..816e106400 100644
--- a/src/network/netdev/wlan.c
+++ b/src/network/netdev/wlan.c
@@ -179,13 +179,12 @@ int config_parse_wiphy(
void *data,
void *userdata) {
- WLan *w = userdata;
+ WLan *w = ASSERT_PTR(userdata);
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(userdata);
if (isempty(rvalue)) {
w->wiphy_name = mfree(w->wiphy_name);
@@ -219,12 +218,11 @@ int config_parse_wlan_iftype(
void *data,
void *userdata) {
- enum nl80211_iftype t, *iftype = data;
+ enum nl80211_iftype t, *iftype = ASSERT_PTR(data);
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(data);
if (isempty(rvalue)) {
*iftype = NL80211_IFTYPE_UNSPECIFIED;