diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-12-27 12:01:53 +0100 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-12-27 12:02:05 +0100 |
commit | 00c0e2f3a09731f5b0161ab528e56c906c3f28aa (patch) | |
tree | daa10cdfcecd080c0c7d0a7fc82d1f961a1f74b0 | |
parent | 542bc494502ebef15aa5de544dc3d953b1127bfc (diff) | |
download | external_libsamsung-ipc-master.zip external_libsamsung-ipc-master.tar.gz external_libsamsung-ipc-master.tar.bz2 |
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | samsung-ipc/devices/aries/aries.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/samsung-ipc/devices/aries/aries.c b/samsung-ipc/devices/aries/aries.c index 321a982..cbc0ede 100644 --- a/samsung-ipc/devices/aries/aries.c +++ b/samsung-ipc/devices/aries/aries.c @@ -764,29 +764,13 @@ int aries_gprs_deactivate(void *data, unsigned int cid) char *aries_gprs_get_iface(unsigned int cid) { char *iface = NULL; - struct ifreq ifr; - int fd; - int rc; - int i; - - memset(&ifr, 0, sizeof(ifr)); - fd = socket(AF_PHONET, SOCK_DGRAM, 0); - if (fd < 0) + if (cid > ARIES_GPRS_IFACE_COUNT) return NULL; - for (i = (ARIES_GPRS_IFACE_COUNT - 1); i >= 0; i--) { - sprintf(ifr.ifr_name, "%s%d", ARIES_GPRS_IFACE_PREFIX, i); - rc = ioctl(fd, SIOCGIFFLAGS, &ifr); - if (rc < 0 || ifr.ifr_flags & IFF_UP) { - continue; - } else { - asprintf(&iface, "%s%d", ARIES_GPRS_IFACE_PREFIX, i); - return iface; - } - } + asprintf(&iface, "%s%d", ARIES_GPRS_IFACE_PREFIX, cid - 1); - return NULL; + return iface; } int aries_gprs_get_capabilities(struct ipc_client_gprs_capabilities *capabilities) |