aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-12-27 12:01:53 +0100
committerPaul Kocialkowski <contact@paulk.fr>2014-12-27 12:02:05 +0100
commit00c0e2f3a09731f5b0161ab528e56c906c3f28aa (patch)
treedaa10cdfcecd080c0c7d0a7fc82d1f961a1f74b0 /samsung-ipc
parent542bc494502ebef15aa5de544dc3d953b1127bfc (diff)
downloadexternal_libsamsung-ipc-00c0e2f3a09731f5b0161ab528e56c906c3f28aa.zip
external_libsamsung-ipc-00c0e2f3a09731f5b0161ab528e56c906c3f28aa.tar.gz
external_libsamsung-ipc-00c0e2f3a09731f5b0161ab528e56c906c3f28aa.tar.bz2
aries: The gprs iface may be requested before it's activatedHEADmaster
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc')
-rw-r--r--samsung-ipc/devices/aries/aries.c22
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)