aboutsummaryrefslogtreecommitdiff
path: root/src/udp.c
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2012-04-24 00:47:30 +0800
committerDiego Nehab <diego.nehab@gmail.com>2012-04-24 00:47:30 +0800
commitc2e29537f576a7082247091036c7957479d42b21 (patch)
treefb6a4da9566e8413d824522ca9a7fb94de049b61 /src/udp.c
parent1acf8188cd732de4fd5fcdc016eeab501c86a773 (diff)
downloadluasocket-c2e29537f576a7082247091036c7957479d42b21.tar.gz
luasocket-c2e29537f576a7082247091036c7957479d42b21.tar.bz2
luasocket-c2e29537f576a7082247091036c7957479d42b21.zip
Fixed getpeername/getsockname situation
- Added IPv6 support to getsockname - Simplified getpeername implementation - Added family to return of getsockname and getpeername and added modification to the manual to describe
Diffstat (limited to 'src/udp.c')
-rw-r--r--src/udp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udp.c b/src/udp.c
index bfa934f..0241cc5 100644
--- a/src/udp.c
+++ b/src/udp.c
@@ -269,12 +269,12 @@ static int meth_dirty(lua_State *L) {
269\*-------------------------------------------------------------------------*/ 269\*-------------------------------------------------------------------------*/
270static int meth_getpeername(lua_State *L) { 270static int meth_getpeername(lua_State *L) {
271 p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{connected}", 1); 271 p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{connected}", 1);
272 return inet_meth_getpeername(L, &udp->sock); 272 return inet_meth_getpeername(L, &udp->sock, udp->family);
273} 273}
274 274
275static int meth_getsockname(lua_State *L) { 275static int meth_getsockname(lua_State *L) {
276 p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1); 276 p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
277 return inet_meth_getsockname(L, &udp->sock); 277 return inet_meth_getsockname(L, &udp->sock, udp->family);
278} 278}
279 279
280/*-------------------------------------------------------------------------*\ 280/*-------------------------------------------------------------------------*\