diff mbox series

[ovs-dev,v2,1/2] ovs-router: expose the ovs_router_get_netdev_source_address function

Message ID 1648825348-7487-1-git-send-email-wenx05124561@163.com
State Accepted
Commit c5bcbd58d6d1f071a9dfde643b6bd61ea0f60883
Headers show
Series [ovs-dev,v2,1/2] ovs-router: expose the ovs_router_get_netdev_source_address function | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

wenxu April 1, 2022, 3:02 p.m. UTC
From: wenxu <wenxu@chinatelecom.cn>

Rename get_src_addr to ovs_router_get_netdev_source_address and expose
this function to prepare for next one

Signed-off-by: wenxu <wenxu@chinatelecom.cn>
---
 lib/ovs-router.c | 13 ++++++++-----
 lib/ovs-router.h |  4 ++++
 2 files changed, 12 insertions(+), 5 deletions(-)

Comments

Eelco Chaudron April 8, 2022, 7:20 a.m. UTC | #1
>     ovs-router: expose the ovs_router_get_netdev_source_address function
>        Rename get_src_addr to ovs_router_get_netdev_source_address and expose
>     this function to prepare for next one
>        Signed-off-by: wenxu <wenxu@chinatelecom.cn>

Changes look good to me.

Acked-by: Eelco Chaudron <echaudro@redhat.com>
Ilya Maximets May 26, 2022, 9:54 a.m. UTC | #2
On 4/8/22 09:20, Eelco Chaudron wrote:
>>     ovs-router: expose the ovs_router_get_netdev_source_address function
>>        Rename get_src_addr to ovs_router_get_netdev_source_address and expose
>>     this function to prepare for next one
>>        Signed-off-by: wenxu <wenxu@chinatelecom.cn>
> 
> Changes look good to me.
> 
> Acked-by: Eelco Chaudron <echaudro@redhat.com>
> 

Applied to master and branch-2.17.  Thanks!

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/lib/ovs-router.c b/lib/ovs-router.c
index 09b81c6..5d0fbd5 100644
--- a/lib/ovs-router.c
+++ b/lib/ovs-router.c
@@ -164,9 +164,10 @@  static void rt_init_match(struct match *match, uint32_t mark,
     match->flow.pkt_mark = mark;
 }
 
-static int
-get_src_addr(const struct in6_addr *ip6_dst,
-             const char output_bridge[], struct in6_addr *psrc)
+int
+ovs_router_get_netdev_source_address(const struct in6_addr *ip6_dst,
+                                     const char output_bridge[],
+                                     struct in6_addr *psrc)
 {
     struct in6_addr *mask, *addr6;
     int err, n_in6, i, max_plen = -1;
@@ -235,9 +236,11 @@  ovs_router_insert__(uint32_t mark, uint8_t priority, bool local,
     p->plen = plen;
     p->local = local;
     p->priority = priority;
-    err = get_src_addr(ip6_dst, output_bridge, &p->src_addr);
+    err = ovs_router_get_netdev_source_address(ip6_dst, output_bridge,
+                                               &p->src_addr);
     if (err && ipv6_addr_is_set(gw)) {
-        err = get_src_addr(gw, output_bridge, &p->src_addr);
+        err = ovs_router_get_netdev_source_address(gw, output_bridge,
+                                                   &p->src_addr);
     }
     if (err) {
         struct ds ds = DS_EMPTY_INITIALIZER;
diff --git a/lib/ovs-router.h b/lib/ovs-router.h
index 34ea163..d8ce3c0 100644
--- a/lib/ovs-router.h
+++ b/lib/ovs-router.h
@@ -37,6 +37,10 @@  void ovs_router_flush(void);
 
 void ovs_router_disable_system_routing_table(void);
 
+int ovs_router_get_netdev_source_address(const struct in6_addr *ip6_dst,
+                                         const char output_bridge[],
+                                         struct in6_addr *psrc);
+
 #ifdef  __cplusplus
 }
 #endif