Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have build the image for coldfire processor using build root 2011.08.Here we are using busybox version 1.18.5 and linux kernel 2.6.30.4.we try to download the image its works fine we got the prompt and file system.While pinging from the device i am facing segv error.
Here code is :
static void sendping_tail(void (*sp)(int), const void *pkt, int size_pkt)
{
/* sizeof(pingaddr) can be larger than real sa size, but I think
* it doesn't matter */
sz = xsendto(pingsock, pkt, size_pkt, &pingaddr.sa, sizeof(pingaddr));
if (sz != size_pkt)
bb_error_msg_and_die(bb_msg_write_error);
if (pingcount == 0 || deadline || ntransmitted < pingcount) {
/* Didn't send all pings yet - schedule next in 1s */
signal(SIGALRM, sp);
if (deadline) {
total_secs += PINGINTERVAL;
if (total_secs >= deadline)
signal(SIGALRM, print_stats_and_exit);
}
alarm(PINGINTERVAL);
} else { /* -c NN, and all NN are sent (and no deadline) */
/* Wait for the last ping to come back.
* -W timeout: wait for a response in seconds.
* Affects only timeout in absense of any responses,
* otherwise ping waits for two RTTs. */
unsigned expire = timeout;
if (nreceived) {
/* approx. 2*tmax, in seconds (2 RTT) */
expire = tmax / (512*1024);
if (expire == 0)
expire = 1;
}
signal(SIGALRM, print_stats_and_exit);
alarm(expire);
}
//memset(pkt, 0, datalen + ICMP_MINLEN + 4); - G.snd_packet was xzalloced
pkt->icmp_type = ICMP_ECHO;
/*pkt->icmp_code = 0;*/
pkt->icmp_cksum = 0; /* cksum is calculated with this field set to 0 */
pkt->icmp_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */
pkt->icmp_id = myid;
/* If datalen < 4, we store timestamp _past_ the packet,
* but it's ok - we allocated 4 extra bytes in xzalloc() just in case.
*/
/*if (datalen >= 4)*/
/* No hton: we'll read it back on the same machine */
*(uint32_t*)&pkt->icmp_dun = monotonic_us();
pkt->icmp_cksum = in_cksum((unsigned short *) pkt, datalen + ICMP_MINLEN);
/* set recv buf (needed if we can get lots of responses: flood ping,
* broadcast ping etc) */
sockopt = (datalen * 2) + 7 * 1024; /* giving it a bit of extra room */
setsockopt(pingsock, SOL_SOCKET, SO_RCVBUF, &sockopt, sizeof(sockopt));
signal(SIGINT, print_stats_and_exit);
/* start the ping's going ... */
sendping4(0);
/* listen for replies */
while (1) {
printf("listen for replies\n");
sendping4(0);
struct sockaddr_in from;
socklen_t fromlen = (socklen_t) sizeof(from);
int c;
I have build the image for coldfire processor using build root 2011.08.Here we are using busybox version 1.18.5 and linux kernel 2.6.30.4.we try to download the image its works fine we got the prompt and file system.While pinging from the device i am facing segv error.
Here code is :
static void sendping_tail(void (*sp)(int), const void *pkt, int size_pkt)
{
/* sizeof(pingaddr) can be larger than real sa size, but I think
* it doesn't matter */
sz = xsendto(pingsock, pkt, size_pkt, &pingaddr.sa, sizeof(pingaddr));
if (sz != size_pkt)
bb_error_msg_and_die(bb_msg_write_error);
if (pingcount == 0 || deadline || ntransmitted < pingcount) {
/* Didn't send all pings yet - schedule next in 1s */
signal(SIGALRM, sp);
if (deadline) {
total_secs += PINGINTERVAL;
if (total_secs >= deadline)
signal(SIGALRM, print_stats_and_exit);
}
alarm(PINGINTERVAL);
} else { /* -c NN, and all NN are sent (and no deadline) */
/* Wait for the last ping to come back.
* -W timeout: wait for a response in seconds.
* Affects only timeout in absense of any responses,
* otherwise ping waits for two RTTs. */
unsigned expire = timeout;
if (nreceived) {
/* approx. 2*tmax, in seconds (2 RTT) */
expire = tmax / (512*1024);
if (expire == 0)
expire = 1;
}
signal(SIGALRM, print_stats_and_exit);
alarm(expire);
}
//memset(pkt, 0, datalen + ICMP_MINLEN + 4); - G.snd_packet was xzalloced
pkt->icmp_type = ICMP_ECHO;
/*pkt->icmp_code = 0;*/
pkt->icmp_cksum = 0; /* cksum is calculated with this field set to 0 */
pkt->icmp_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */
pkt->icmp_id = myid;
/* If datalen < 4, we store timestamp _past_ the packet,
* but it's ok - we allocated 4 extra bytes in xzalloc() just in case.
*/
/*if (datalen >= 4)*/
/* No hton: we'll read it back on the same machine */
*(uint32_t*)&pkt->icmp_dun = monotonic_us();
pkt->icmp_cksum = in_cksum((unsigned short *) pkt, datalen + ICMP_MINLEN);
/* set recv buf (needed if we can get lots of responses: flood ping,
* broadcast ping etc) */
sockopt = (datalen * 2) + 7 * 1024; /* giving it a bit of extra room */
setsockopt(pingsock, SOL_SOCKET, SO_RCVBUF, &sockopt, sizeof(sockopt));
signal(SIGINT, print_stats_and_exit);
/* start the ping's going ... */
sendping4(0);
/* listen for replies */
while (1) {
printf("listen for replies\n");
sendping4(0);
struct sockaddr_in from;
socklen_t fromlen = (socklen_t) sizeof(from);
int c;
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.