[MERGED] osmo-ggsn[master]: ggsn: Don't explicitly use tun_setaddr() API anymore

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Apr 25 20:22:06 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: ggsn: Don't explicitly use tun_setaddr() API anymore
......................................................................


ggsn: Don't explicitly use tun_setaddr() API anymore

tun_addaddr() internally contains a fallback to tun_setaddr() for the
first address, so we can unify the API usage a bit and use tun_addaddr()
from all call sites

Change-Id: I34de003a1a040254bd38b29e48caea34cb0c88d2
---
M ggsn/ggsn.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index bbdb5c8..85a2211 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -220,7 +220,7 @@
 		if (apn->v4.cfg.ifconfig_prefix.addr.len) {
 			LOGPAPN(LOGL_INFO, apn, "Setting tun IP address %s\n",
 				in46p_ntoa(&apn->v4.cfg.ifconfig_prefix));
-			if (tun_setaddr(apn->tun.tun, &apn->v4.cfg.ifconfig_prefix.addr, NULL,
+			if (tun_addaddr(apn->tun.tun, &apn->v4.cfg.ifconfig_prefix.addr, NULL,
 					apn->v4.cfg.ifconfig_prefix.prefixlen)) {
 				LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv4 address %s: %s\n",
 					in46p_ntoa(&apn->v4.cfg.ifconfig_prefix), strerror(errno));
@@ -232,7 +232,7 @@
 		if (apn->v6.cfg.ifconfig_prefix.addr.len) {
 			LOGPAPN(LOGL_INFO, apn, "Setting tun IPv6 address %s\n",
 				in46p_ntoa(&apn->v6.cfg.ifconfig_prefix));
-			if (tun_setaddr(apn->tun.tun, &apn->v6.cfg.ifconfig_prefix.addr, NULL,
+			if (tun_addaddr(apn->tun.tun, &apn->v6.cfg.ifconfig_prefix.addr, NULL,
 					apn->v6.cfg.ifconfig_prefix.prefixlen)) {
 				LOGPAPN(LOGL_ERROR, apn, "Failed to set tun IPv6 address %s: %s. "
 					"Ensure you have ipv6 support and not used the disable_ipv6 sysctl?\n",

-- 
To view, visit https://gerrit.osmocom.org/7925
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I34de003a1a040254bd38b29e48caea34cb0c88d2
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list