Skip to content

Commit

Permalink
Merge pull request #633 from AltraMayor/gtlookup
Browse files Browse the repository at this point in the history
gt: fix l_lpm_lookup() and l_lpm6_lookup()
  • Loading branch information
AltraMayor authored Mar 2, 2023
2 parents 84b069a + 8002687 commit 99919a0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions gt/lua_lpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ l_lpm_lookup(lua_State *l)
}

ret = fib_lookup(&lpm_ud->fib, (uint8_t *)&ip, &label);
if (ret < 0)
lua_pushinteger(l, ret);
lua_pushinteger(l, label);
lua_pushinteger(l, ret >= 0 ? (lua_Integer)label : ret);
return 1;
}

Expand Down Expand Up @@ -505,9 +503,7 @@ l_lpm6_lookup(lua_State *l)
}

ret = fib_lookup(&lpm6_ud->fib, ipv6_addr->s6_addr, &label);
if (ret < 0)
lua_pushinteger(l, ret);
lua_pushinteger(l, label);
lua_pushinteger(l, ret >= 0 ? (lua_Integer)label : ret);
return 1;
}

Expand Down

0 comments on commit 99919a0

Please sign in to comment.